import jieba

content = "工信处女干事"

# 精确模式
res = jieba.lcut(content, cut_all=False)
print(res)
# ['工信处', '女干事']

# 全模式分词
res = jieba.lcut(content, cut_all=True)
print(res)
# ['工信处', '处女', '女干事', '干事']

# 搜索引擎分词,精确模式基础上对长词再切分
res = jieba.lcut_for_search(content)
print(res)
# ['工信处', '干事', '女干事']

# 繁体分词
content_fanti = "都說我喜歡笑,誰知道我哭的時候多麼的撕心裂"
res = jieba.lcut(content_fanti, cut_all=False)
print(res)

# 加载用户自定义词典
res = jieba.lcut("八一双鹿更名为南昌篮球队")
print(res)
jieba.load_userdict("./userdict.txt")
res = jieba.lcut("八一双鹿更名为南昌篮球队")
print(res)